home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 December / 2004-12 CHIP.iso / CHIP / Porady / Srodowisko PHP-MySQL / WAMP5 1.3 / wamp5_1.3.exe / {app} / www / sqlitemanager / left.php < prev    next >
PHP Script  |  2004-09-24  |  3KB  |  76 lines

  1. <?php
  2. /**
  3. * Web based SQLite management
  4. * Show navigation into databases
  5. * @package SQLiteManager
  6. * @author FrΘdΘric HENNINOT
  7. * @version $Id: left.php,v 1.17 2004/09/12 18:56:32 freddy78 Exp $ $Revision: 1.17 $
  8. */
  9.  
  10. include_once "./include/defined.inc.php";
  11. include_once INCLUDE_LIB."config.inc.php";
  12. ?>
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  14. <html>
  15.     <head>
  16.     <meta http-equiv="content-type" content="text/html;charset=<?php echo $charset ?>">    
  17.     <link href="theme/<?php echo $localtheme ?>/left.css" rel="stylesheet" type="text/css">
  18.     </head>
  19.  
  20.     <body>
  21.         <div align="center" width=100% style="background: white; padding-top: 5px; padding-bottom: 5px"><img src="theme/default/pics/sqlitemanager.png" border=0></div>
  22.         <div align="center" style="margin-top: 5px">
  23.         <a href="index.php" class="base" target="_parent"><?php echo $traduct->get(1); ?></a>
  24.         </div>
  25.         <table width="100%" border="0" cellspacing="0" cellpadding="0">        
  26. <?php
  27. $query = "SELECT * FROM database";
  28. $tabDb = SQLiteArrayFunction($db, $query, SQLITE_ASSOC);
  29. foreach($tabDb as $ligne){
  30.     echo "    <tr valign=\"middle\" class=\"database\">\n
  31.                 <td width=\"20\">".displayPics("database".((in_array($ligne["id"], $attachDbList))? "_link" : "" ).".png", "", 0, 20)."</td>\n
  32.                 <td><a href=\"index.php?dbsel=".$ligne["id"]."\" target=\"_parent\" class=\"dbsel\">".$ligne["name"]."</a></td>\n
  33.             </tr>\n";
  34.     if($dbsel == $ligne["id"]){
  35.         include_once INCLUDE_LIB."SQLiteDbConnect.class.php";
  36.         $workDb = &new SQLiteDbConnect($ligne["location"]);
  37.         if(is_resource($workDb->connId)){
  38.             echo "    <tr valign=\"middle\">
  39.                         <td colspan=2 align=\"right\">
  40.                             <table width=\"90%\" border=0 cellspacing=0 cellpadding=0>";
  41.             foreach($dbItems as $item){
  42.                 $list = $workDb->getPropList($item);
  43.                 if(is_array($list) && count($list)) foreach($list as $Name){
  44.                     $actionLink = "<a href=\"main.php?dbsel=$dbsel&".strtolower($item)."=".urlencode($Name)."\" target=\"main\" class=\"item\">";                
  45.                     echo "    <tr>";
  46.                     echo "            <td>".$actionLink.displayPics(strtolower($item)."s.png")."</a></td>";                    
  47.                     echo "            <td class=\"item\" nowrap=\"nowrap\">";
  48.                     if(($item!="Function") && ($item!="Trigger")) echo "<a href=\"main.php?dbsel=$dbsel&".strtolower($item)."=".urlencode($Name)."&action=browseItem\" target=\"main\">".displayPics("browse.png", "", 0, 10)."</a>";
  49.                     else echo displayPics("nobrowse.png");
  50.                     echo " ".$actionLink.$Name."</a></td>
  51.                             </tr>\n";
  52.                 } elseif($displayEmptyItemLeft) {
  53.                     $actionLink = "<a href=\"main.php?dbsel=$dbsel&action=add_".strtolower($item)."\" target=\"main\" class=\"item\">";
  54.                     echo "    <tr>
  55.                                 <td width=\"25\">".$actionLink.displayPics(strtolower($item)."s.png")."</a></td>
  56.                                 <td class=\"".strtolower($item)."\" nowrap=\"nowrap\">".displayPics("nobrowse.png")." ";
  57.                                 if(!$workDb->isReadOnly() && displayCondition("properties")) echo $actionLink."+ ".$itemTranslated[$item]."</a></td>";
  58.                                 else echo "<span class='item'><i>+ ".$itemTranslated[$item]."</i></span>";
  59.                     echo "    </tr>\n";
  60.                 }                
  61.             }
  62.             echo "            </table>
  63.                         </td>
  64.                     </tr>";
  65.         }
  66.     }    
  67. }
  68. echo "    </table>
  69.         </body>
  70.     </html>\n";
  71. if(isset($workDb) && $workDb->connId && ($workDb->baseName!=":memory:")) {
  72.     $workDb->close();
  73.     @sqlite_close($db);
  74. }
  75. ?>
  76.